home *** CD-ROM | disk | FTP | other *** search
/ Micromanía 93 / CDMM_93_2.ISO / Project Nomads / nomads_demo_eng.exe / OBSERVER.TCL < prev    next >
Encoding:
Text File  |  2001-12-13  |  2.3 KB  |  102 lines

  1. #
  2. #   Zustands-▄berwachungs-Script
  3. #   State Watch Script
  4. #
  5. #   Flak
  6. #
  7. #   created:    15-Jun-2000 Bernd
  8. #   
  9. #   (C) COPYRIGHT 2000 RADONLABS GMBH
  10. #
  11.  
  12. proc observerwatch_normal {} {
  13.  
  14.     set tower [.getcreator]
  15.  
  16.     # Nur, um zu verzweigen
  17.     if {[.iskilled] == "true"} {
  18.         .setremoveable true
  19.         leavevehicle
  20.     } elseif {[$tower.getsleepmode] == "true"} {
  21.         .announcestate offline
  22.     } else {
  23.         .announcestate waitsearch
  24.     }
  25. }
  26.  
  27. proc observerwatch_waitsearch {} {
  28.  
  29.     set tower [.getcreator]
  30.     
  31.     if {[.iskilled] == "true"} {
  32.         .setremoveable true
  33.         leavevehicle
  34.     } elseif {"false" == [[.getclan].hasenergy]} {
  35.         .deletettarget
  36.         .announcestate outofwork
  37.     } elseif {[$tower.getsleepmode] == "true"} {
  38.         .announcestate offline
  39.     } elseif {[.isshadow] == "false"} {
  40.     
  41.         # Suche Ziel und teste, ob es fuer uns geeignet ist.
  42.         # Dies nur machen, wenn ich ein original bin.
  43.         set tgt [.searchtarget]
  44.         if { ($tgt != "null") && ([.testvehicleastarget $tgt] == "true") } {
  45.             .setvehicletarget $tgt 300 true
  46.             .announcestate observe
  47.         }
  48.     }
  49. }
  50.  
  51. proc observerwatch_outofwork {} {
  52.  
  53.     set tower [.getcreator]
  54.  
  55.     if {[.iskilled] == "true"} {
  56.         .setremoveable true
  57.         leavevehicle
  58.     } elseif {"true" == [[.getclan].hasenergy]} {
  59.     
  60.         # Strom wieder da
  61.         .announcestate waitsearch
  62.     } elseif {[$tower.getsleepmode] == "true"} {
  63.         .announcestate offline
  64.     }
  65. }
  66.  
  67. proc observerwatch_offline {} {
  68.  
  69.     set tower [.getcreator]
  70.  
  71.     if {[.iskilled] == "true"} {
  72.         .setremoveable true
  73.         leavevehicle
  74.     } elseif {"false" == [$tower.getsleepmode]} {
  75.         .announcestate waitsearch
  76.     }
  77. }
  78.  
  79.  
  80. proc observerwatch_observe {} {
  81.  
  82.     set tower [.getcreator]
  83.         
  84.     if {[.iskilled] == "true"} {
  85.         .setremoveable true
  86.         leavevehicle
  87.     } elseif {[.hastarget] == "false"} {
  88.         .announcestate waitsearch
  89.     } elseif {[.istargetreachable] == "false"} {
  90.         .deletetarget
  91.         .announcestate waitsearch
  92.     } elseif {[$tower.getsleepmode] == "true"} {
  93.         .announcestate offline
  94.     }
  95. }
  96.  
  97.  
  98. proc observerwatch_cinematic {} {
  99.     
  100.     # empty
  101. }
  102.